﻿///////////////////////////////////////////////////////////////
// This is generated code. If you modify this code, be aware
// of the fact that when you re-generate the code, your changes
// are lost. If you want to keep your changes, make this file read-only
// when you have finished your changes, however it is recommended that
// you inherit from this class to extend the functionality of this generated
// class or you modify / extend the templates used to generate this code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 1.0.2005.1
// Code is generated on: Friday, March 07, 2008 3:18:12 PM
// Code is generated using templates: C# template set for SqlServer (1.0.2005.1)
// Templates vendor: Solutions Design.
// Templates version: 1.0.2005.1.111705
//////////////////////////////////////////////////////////////
using System;

using RPSDAL;
using RPSDAL.FactoryClasses;
using RPSDAL.HelperClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace RPSDAL.RelationClasses
{
	/// <summary>
	/// Implements the static Relations variant for the entity: Call.
	/// This class is generated. Do not modify.
	/// </summary>
	public partial class CallRelations
	{
		/// <summary>
		/// CTor
		/// </summary>
		public CallRelations()
		{
		}

		#region Class Property Declarations

		/// <summary>Returns a new IEntityRelation object, between CallEntity and CallFinishedValueEntity over the 1:n relation they have, using the relation between the fields:
		/// Call.CallId - CallFinishedValue.CallId
		/// </summary>
		public virtual IEntityRelation CallFinishedValueEntityUsingCallId
		{
			get
			{

				IEntityRelation relation = new EntityRelation(RelationType.OneToMany);
				relation.StartEntityIsPkSide = true;
				relation.AddEntityFieldPair(EntityFieldFactory.Create(CallFieldIndex.CallId), EntityFieldFactory.Create(CallFinishedValueFieldIndex.CallId));
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallFinishedValueEntity", false);
				return relation;
			}
		}
	
		/// <summary>Returns a new IEntityRelation object, between CallEntity and ContactHistoryEntity over the 1:n relation they have, using the relation between the fields:
		/// Call.CallId - ContactHistory.CallId
		/// </summary>
		public virtual IEntityRelation ContactHistoryEntityUsingCallId
		{
			get
			{

				IEntityRelation relation = new EntityRelation(RelationType.OneToMany);
				relation.StartEntityIsPkSide = true;
				relation.AddEntityFieldPair(EntityFieldFactory.Create(CallFieldIndex.CallId), EntityFieldFactory.Create(ContactHistoryFieldIndex.CallId));
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ContactHistoryEntity", false);
				return relation;
			}
		}
	
	
	
		/// <summary>Returns a new IEntityRelation object, between CallEntity and BusinessRuleEntity over the m:1 relation they have, using the relation between the fields:
		/// Call.BusinessRuleId - BusinessRule.BusinessRuleId
		/// </summary>
		public virtual IEntityRelation BusinessRuleEntityUsingBusinessRuleId
		{
			get
			{

				IEntityRelation relation = new EntityRelation(RelationType.ManyToOne);
				relation.StartEntityIsPkSide = false;
				relation.AddEntityFieldPair(EntityFieldFactory.Create(BusinessRuleFieldIndex.BusinessRuleId), EntityFieldFactory.Create(CallFieldIndex.BusinessRuleId));
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("BusinessRuleEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallEntity", true);
				return relation;
			}
		}
	
		/// <summary>Returns a new IEntityRelation object, between CallEntity and ContactEntity over the m:1 relation they have, using the relation between the fields:
		/// Call.ContactId - Contact.ContactId
		/// </summary>
		public virtual IEntityRelation ContactEntityUsingContactId
		{
			get
			{

				IEntityRelation relation = new EntityRelation(RelationType.ManyToOne);
				relation.StartEntityIsPkSide = false;
				relation.AddEntityFieldPair(EntityFieldFactory.Create(ContactFieldIndex.ContactId), EntityFieldFactory.Create(CallFieldIndex.ContactId));
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ContactEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallEntity", true);
				return relation;
			}
		}
	
		/// <summary>Returns a new IEntityRelation object, between CallEntity and UserEntity over the m:1 relation they have, using the relation between the fields:
		/// Call.UserId - User.UserId
		/// </summary>
		public virtual IEntityRelation UserEntityUsingUserId
		{
			get
			{

				IEntityRelation relation = new EntityRelation(RelationType.ManyToOne);
				relation.StartEntityIsPkSide = false;
				relation.AddEntityFieldPair(EntityFieldFactory.Create(UserFieldIndex.UserId), EntityFieldFactory.Create(CallFieldIndex.UserId));
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("UserEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("CallEntity", true);
				return relation;
			}
		}
	

		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSuperTypeRelation() { return null;}

		#endregion

		#region Included Code

		#endregion
	}
}
